<?php
/**
 * Author:xsc
 * Time:2023/11/21 10:17
 */

namespace App\Repository;

use  App\Models\OpenCallback;

class OpenCallbackRepo extends BaseRepo
{

    /**
     * 新增/更新
     * @param array $data
     * @param int $id
     * @return int
     * Author:xsc
     * Time:2023/11/21 10:21
     */
    public function save(array $data, int $id = 0)
    {
        if ($id) {
            return OpenCallback::query()->where('id', $id)->update($data) ? $id : 0;
        } else {
            return OpenCallback::query()->insertGetId($data);
        }
    }

}
